home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Complementary Applications 2004 February / SGI IRIX 6.5 Complementary Applications 2004 February.iso / dist / cde.idb / usr / dt / bin / dtfile_error.z / dtfile_error
Encoding:
Text File  |  2003-11-18  |  1.8 KB  |  68 lines

  1. #! /usr/dt/bin/dtksh
  2. #####################################################################
  3. #  Display an error dialog using the argument(s) as the message
  4. #
  5. #  This script can be used by applications to display an error
  6. #  dialog when it would be difficult or impossible to do in the
  7. #  context of the executing program. For example, it can be used
  8. #  when exec fails in a child process or if an error is detected
  9. #  before an applications main window can be realized.
  10. #
  11. #  (c) Copyright 1993, 1994 Hewlett-Packard Company
  12. #  (c) Copyright 1993, 1994 International Business Machines Corp.
  13. #  (c) Copyright 1993, 1994 Sun Microsystems, Inc.
  14. #  (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
  15. #      Novell, Inc.
  16. #
  17. #  Product:      @(#)TED_VERSION_STRING2, dtfile_error
  18. #                @(#)TED FileVersion: dtfile_error: $Id: dtfile_error.src,v 1.1 2000/04/18 23:40:52 simon.longdrop.melbourne.1.com Exp $
  19. #
  20. ######################################################################
  21.  
  22. #--------------------
  23. # OK button callback
  24. #--------------------
  25.  
  26. okCallback()
  27. {
  28.    exit
  29. }
  30.  
  31.  
  32. #------
  33. # main
  34. #------
  35.  
  36. MESSAGE="$@"
  37.  
  38. TITLE="dt Error"
  39.  
  40.  
  41. XtInitialize TOP dtError DtError "$@"
  42. #ifdef 1
  43. XtDisplay DISPLAY $TOP
  44. #endif /* SPR007204 */
  45.  
  46. XmCreateErrorDialog DIALOG \
  47.                     $TOP \
  48.                     "Test" \
  49.                     dialogTitle:"$TITLE" \
  50.                     messageString:"$MESSAGE"
  51.  
  52. # remove cancel and help buttons
  53. XmMessageBoxGetChild CANCEL $DIALOG DIALOG_CANCEL_BUTTON
  54. XmMessageBoxGetChild HELP   $DIALOG DIALOG_HELP_BUTTON
  55. XtUnmanageChild $CANCEL
  56. XtUnmanageChild $HELP
  57.  
  58. XtAddCallback $DIALOG okCallback "okCallback"
  59.  
  60. XtManageChild $DIALOG
  61.  
  62. #ifdef 1
  63. XmInternAtom wm_delete_window $DISPLAY "WM_DELETE_WINDOW" False
  64. XmAddWMProtocolCallback $(XtParent "-" $DIALOG) $wm_delete_window "okCallback"
  65. #endif /* SPR007204 */
  66.  
  67. XtMainLoop
  68.